package com.luocj.muke.demo.fragment;

import android.content.Context;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.luocj.muke.common.dialog.dialog.MyDialog;
import com.luocj.muke.demo.R;
import com.luocj.muke.demo.adapter.TestAdapter;
import com.luocj.muke.demo.adapter.TestBAdapter;
import com.luocj.muke.demo.utils.SPUtils;
import com.luocj.muke.demo.utils.StatusbarUtils;
import com.luocj.muke.demo.utils.Utils;
import com.luocj.muke.demo.view.CustomProgressNumber;
import com.luocj.muke.demo.view.ObservableScrollView;
import com.yanzhenjie.permission.AndPermission;
import com.yanzhenjie.permission.Permission;

import java.util.ArrayList;

public class MineFragment extends BaseFragment implements View.OnClickListener {

    private static final String TAG = MineFragment.class.getSimpleName();
    private View mine;
    private Button showDialog;
    private ImageView imageview;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mine = inflater.inflate(R.layout.fragment_mine, container, false);
        return mine;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {

        AndPermission.with(this)
                .runtime()
                .permission(Permission.Group.STORAGE)
                .onGranted(permissions -> {
                    // Storage permission are allowed.
                    Log.i(TAG, "onViewCreated: " + "allow");
                })
                .onDenied(permissions -> {
                    // Storage permission are not allowed.
                    Log.i(TAG, "onViewCreated: " + "denied");
                })
                .start();

        mine.findViewById(R.id.btn_load_iamgeview).setOnClickListener(this);
        imageview = mine.findViewById(R.id.imageview);

        String string = SPUtils.getString(getActivity(), "key", "default");
        Log.i(TAG, "onViewCreated: " + string);
    }



    @Override
    protected void loadData() {

    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        switch (id) {
            case R.id.btn_load_iamgeview:
                break;




        }
    }
}
